import request from '@/utils/request'

// 查询值班列表
export function listDuty(query) {
  return request({
    url: '/allocation/duty/list',
    method: 'get',
    params: query
  })
}

// 查询值班详细
export function getDuty(id) {
  return request({
    url: '/allocation/duty/' + id,
    method: 'get'
  })
}

// 新增值班
export function addDuty(data) {
  return request({
    url: '/allocation/duty',
    method: 'post',
    data: data
  })
}

// 修改值班
export function updateDuty(data) {
  return request({
    url: '/allocation/duty',
    method: 'put',
    data: data
  })
}

// 删除值班
export function delDuty(id) {
  return request({
    url: '/allocation/duty/' + id,
    method: 'delete'
  })
}

// 消息状态修改
export function changeNoticeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/allocation/duty/changeStatus',
    method: 'put',
    data: data
  })
}
